using System.Collections.Generic;
using System.Web.Core;

namespace Forum.Business
{
    public class ThreadRequest : TEntityRequest<Thread>
    {
        public ThreadRequest()
        {
            EntityId = GetParameterValue<int>(ForumParameterName.ThreadId);
        }
    }
    public class ThreadListRequest : TEntityListRequest<Thread>
    {
        private int? sectionId = GetParameterValue<int?>(ForumParameterName.SectionId);
        private int? authorId = GetParameterValue<int?>(ForumParameterName.AuthorId);
        private int? replierId = GetParameterValue<int?>(ForumParameterName.ReplierId);
        private int? threadStatus = GetParameterValue<int?>(ForumParameterName.ThreadStatus);
        private int? threadReleaseStatus = GetParameterValue<int?>(ForumParameterName.ThreadReleaseStatus);
        private int? orderField = null;

        public int? SectionId
        {
            get
            {
                return sectionId;
            }
            set
            {
                sectionId = value;
            }
        }
        public int? AuthorId
        {
            get
            {
                return authorId;
            }
            set
            {
                authorId = value;
            }
        }
        public int? ReplierId
        {
            get
            {
                return replierId;
            }
            set
            {
                replierId = value;
            }
        }
        public int? ThreadStatus
        {
            get
            {
                if (threadStatus == 1000)
                {
                    threadStatus = null;
                }
                return threadStatus;
            }
            set
            {
                threadStatus = value;
            }
        }
        public int? ThreadReleaseStatus
        {
            get
            {
                return threadReleaseStatus;
            }
            set
            {
                threadReleaseStatus = value;
            }
        }
        public int? OrderField
        {
            get
            {
                return orderField;
            }
            set
            {
                orderField = value;
            }
        }
    }
    public class ThreadReply : EntityReply
    {
        private int totalRecords = 0;

        public int TotalRecords
        {
            get
            {
                return totalRecords;
            }
            set
            {
                totalRecords = value;
            }
        }
    }
}